package org.jsbd.boss.dao.impl;

import java.util.ArrayList;
import java.util.List;

import org.jsbd.boss.dao.ImsiLogDAO;
import org.jsbd.boss.domian.channel.ImsiApkLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import edu.hziee.common.queue.IBatchExecutor;

@Service("imsiLogDao")
public class ImsiLogDaoImpl extends CrackLogBaseDao implements ImsiLogDAO, IBatchExecutor<ImsiApkLog> {
	public static final Logger LOGGER = LoggerFactory.getLogger(ImsiLogDaoImpl.class);

	@Override
	public List<ImsiApkLog> selectApkLogs(String currentDate) {
		try {
			ImsiApkLog log = new ImsiApkLog();
			log.setCurrentDate(currentDate);
			return super.queryForList("qy_imsi_log.SELECT_IMSI_LOG", log);
		} catch (Exception e) {
			LOGGER.error("Any error msg that u want to write",e);
		}
		return new ArrayList<ImsiApkLog>();
	}

	@Override
	public void execute(List<ImsiApkLog> records) {
		super.batchInsert("qy_imsi_log.INSERT_IMSI_LOG", records);
	}


	@Override
	public void updateFlag(List<ImsiApkLog> list) {
		super.batchUpdate("qy_imsi_log.UPDATE_IMSI_FLAG", list);
	}
}
